<?php
		include("dbconn.inc");
		include("dbfuc.inc");
		include("session.inc");		
		$dbconnection=$_SESSION["dbconnection"];		
	if(session_is_registered("dbconnection") )
	{
		$user=$_SESSION["user"];
		$curid=$_SESSION["curid"];
		$errortable = array();
		//echo $user;
		$randam= rand(5, 100000);
		$_SESSION["sessionrandom"]=$randam;
	

		if(($user!="") && (($curid!="") || ($curid!=0)))
			{
			
		
?>
<html>
<head>
<title>inner</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {	font-size: 9px;
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.style7 {font-family: Geneva, Arial, Helvetica, sans-serif}
-->
</style>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF">
<!-- ImageReady Slices (inner.psd) -->
<table id="Table_01" width="1003" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="10"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1003" height="167">
          <param name="movie" value="images/inner_header.swf">
          <param name="quality" value="high">
          <embed src="images/inner_header.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1003" height="167"></embed>
	    </object></td>
	</tr>
	<tr>
		<td rowspan="2">
			<img src="images/inner_02.jpg" width="220" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_03.jpg" width="98" height="29" alt=""></td>
		<td>
			<img src="images/inner_04.jpg" width="44" height="6" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_05.jpg" width="47" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_06.jpg" width="54" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_07.jpg" width="102" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_08.jpg" width="96" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_09.jpg" width="124" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_10.jpg" width="106" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_11.jpg" width="112" height="29" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="images/inner_12.jpg" width="44" height="23" alt=""></td>
	</tr>
	<tr>
		<td height="19" background="images/inner_15.jpg">&nbsp;</td>
		<td colspan="9" rowspan="2" valign="top" bgcolor="#FFFFFF"><p>&nbsp;</p>
          <table width="98%" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td><table width="775" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#FFFFFF">
<?php			$sql="";
			$rs="";
			$numrows=0;
			$cCode="";$cCodeDesc="";$cSelect="";
			$errcount=0;	
			
/*Registration Address validation */
			$cmbRegStatus=$_REQUEST["cmbRegStatus"];
			$txtFnameReg=$_REQUEST["txtFnameReg"];
			$regtiksex=$_REQUEST["regtiksex"];
			$regCountry=$_REQUEST["regCountry"];
			$txtAddr1Reg=$_REQUEST["txtAddr1Reg"];
			$txtAddr2Reg =$_REQUEST["txtAddr2Reg"];
			$txtAddr3Reg =$_REQUEST["txtAddr3Reg"];
			$cmbStateReg =$_REQUEST["cmbStateReg"];
			$txtPinCodeReg=$_REQUEST["txtPinCodeReg"];
			$txtEmailReg =$_REQUEST["txtEmailReg"];
			$txtPhoneReg =$_REQUEST["txtPhoneReg"];
			$txtPhone2Reg =$_REQUEST["txtPhone2Reg"];	
			$txtFnameReg=trim($txtFnameReg);
			$ccouponuser=$_REQUEST["txtcouponuser"];	
			$ccouponpassword=$_REQUEST["txtcouponpassword"];
//ACCOUNT PIN DTLS
			$pin1=$_REQUEST["pin1"];
			$pin2=$_REQUEST["pin2"];
			$pin3=$_REQUEST["pin3"];
			$pin4=$_REQUEST["pin4"];
			$accountpin=$pin1.$pin2.$pin3.$pin4;
/* Basic Nodes Details */
			 $cBsnsName=$_REQUEST["txtLogin"];
			 $cPassword =$_REQUEST["txtPassword"];
			 $cUpline=$_REQUEST["txtUpline"];
			 $cSideId=$_REQUEST["radSide"];
			 $cSecretQuest =$_REQUEST["cmbSecret"];
			 $cAnsw=$_REQUEST["txtAnsw"];
			 $cRefferal=$_REQUEST["txtrefferal"];
			 
			 
 			//placement detail validation Critical validations */
			$nLeftFlag=0;
			$nRightFlag=0;
			$nUplineId=0;
			$refferalid=0;
			
//inserting requested values into session

			$_SESSION['cmbRegStatus']=$cmbRegStatus;	
			$_SESSION['txtFnameReg']=$txtFnameReg;	
			$_SESSION['regtiksex']=$regtiksex;	
			$_SESSION['regCountry']=$regCountry;	
			$_SESSION['txtAddr1Reg']=$txtAddr1Reg;	
			$_SESSION['txtAddr2Reg']=$txtAddr2Reg;	
			$_SESSION['txtAddr3Reg']=$txtAddr3Reg;	
			$_SESSION['cmbStateReg']=$cmbStateReg;	
			$_SESSION['txtPinCodeReg']=$txtPinCodeReg;	
			$_SESSION['txtEmailReg']=$txtEmailReg;	
			$_SESSION['txtPhoneReg']=$txtPhoneReg;	
			$_SESSION['txtPhone2Reg']=$txtPhone2Reg;	
			
			$_SESSION['cBsnsName']=$cBsnsName;	
			$_SESSION['cPassword']=$cPassword;	
			$_SESSION['cUpline']=$cUpline;	
			$_SESSION['cRefferal']=$cRefferal;	
			$_SESSION['cSideId']=$cSideId;	
			$_SESSION['cSecretQuest']=$cSecretQuest;	
			$_SESSION['cAnsw']=$cAnsw;	
			$_SESSION['ccouponuser']=$ccouponuser;	
			$_SESSION['ccouponpassword']=$ccouponpassword;	
			
			$_SESSION['pin1']=$pin1;
			$_SESSION['pin2']=$pin2;
			$_SESSION['pin3']=$pin3;
			$_SESSION['pin4']=$pin4;
			$_SESSION['accountpin']=$accountpin;
			
			
//contact address validation
//name checking
	       if($cmbRegStatus=="none")  {
				$errcount=$errcount+1;
				$errortable[$errcount]="Invalid Status entry in Contact Address(Not Selected)";       		
			}
			if(checkString($txtFnameReg)) {
        		$errcount=$errcount+1;
				$errortable[$errcount]="Invalid  Full Name entry in Contact Address (Empty)";  			
			}
			else
			{
				if(isContainSpecialChars($txtFnameReg)){
					$errcount=$errcount+1;
					$errortable[$errcount]="Invalid  Full Name entry in Contact Address (Invalid Characters)"; 
				}
			 	else
				{
	    	       	if(strlen($txtFnameReg)>70) {
					$errcount=$errcount+1;
					$errortable[$errcount]="Invalid  Full Name entry in Contact Address (Maximum seventy characters)"; 
    	        	}
           		} 
     		 }
//gender checking
         if(checkString($regtiksex)) 
         {
			$errcount=$errcount+1;
			$errortable[$errcount]="Invalid Sex in Contact Address (Not Selected)";       
         }		
//country checking
		if($regCountry=="none") 
   		{
			$errcount=$errcount+1;
			$errortable[$errcount]="Invalid Country in Contact Address (Not Selected)";       
      	}
//address checking
        if(checkString($txtAddr1Reg))  {
			$errcount=$errcount+1;
			$errortable[$errcount]="Invalid  Address1 entry in Contact Address (Empty)"; 
         }
		else
		{
    		if(strlen($txtAddr1Reg)>75) {
				$errcount=$errcount+1;
				$errortable[$errcount]="Invalid  Address1 entry in Contact Address (Maximum thirty characters)"; 
    		 }
     	}
		if(checkString($txtAddr2Reg)) {
			$errcount=$errcount+1;
			$errortable[$errcount]="Invalid  Address2 entry in Contact Address (Empty)"; 
        }
    	else
    	{
    		if(strlen($txtAddr2Reg)>75) {
			$errcount=$errcount+1;
			$errortable[$errcount]="Invalid  Address2 entry in Contact Address (Maximum thirty characters)"; 
            }
     	}
		if(strlen($txtAddr3Reg)>50) {
			$errcount=$errcount+1;
			$errortable[$errcount]="Invalid  Address3 entry in Contact Address (Maximum thirty characters)"; 
	    }
		if(checkString($cmbStateReg)) 
        {
			$errcount=$errcount+1;
			$errortable[$errcount]="Invalid State in Contact Address (Empty)";       
        }
		if(checkString($txtPinCodeReg))  {
			$errcount=$errcount+1;
			$errortable[$errcount]="Invalid  Pincode Entry in Contact Address (Empty)"; 
        }
		else
		{
			if(strlen($txtPinCodeReg)!=6) {
			$errcount=$errcount+1;
			$errortable[$errcount]="Invalid  Pincode Entry in Contact Address(Maximum 6 digits)"; 
    	    }
			else
			{	
				if(checkInt($txtPinCodeReg))  {
					$errcount=$errcount+1;
					$errortable[$errcount]="Invalid  Pincode Entry in Contact Address(Numeric Only)"; 
				}
         	}
		 }
	if(strlen($txtEmailReg)==0) {
		$errcount=$errcount+1;
		$errortable[$errcount]="Email ID Empty ";
	}
	else
	{
		if(!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$",$txtEmailReg))
		{
			$errcount=$errcount+1;
			$errortable[$errcount]=" Invalid Email ID";
		}
	}		 
    if(strlen($txtPhoneReg)>50) {
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid  Telephone No Entry in Contact Address (Maximum fifty characters)"; 
    }
	if(checkString($txtPhone2Reg))  {
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid   Mobile Entry in Contact Address (Empty)"; 
	}
	if(strlen($txtPhone2Reg)>50) {
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid  Mobile Entry in Contact Address(Maximum fifty charecters)"; 
   }
		


//username checking			
			if(checkString($cBsnsName)) { 
				$errcount=$errcount+1;
				$errortable[$errcount]="Invalid Username (Empty)"; 
           		}
				else{
					if(isContainSpecialCharsforusername($cBsnsName)) {
							$errcount=$errcount+1;
							$errortable[$errcount]="Invalid  Username Code (Capital letters and Digits only)"; 
						}
   		 	    		else if(strlen($cBsnsName)<3){
							$errcount=$errcount+1;
							$errortable[$errcount]="Username must have Minimum Three characters";
   	         				}
     	          			else
							{
	 	 	       				if(strlen($cBsnsName)>10){
									$errcount=$errcount+1;
									$errortable[$errcount]="Invalid  Username Code (Maximum Ten characters)"; 
    		       				}
								else {
									$numR=0;$result=="";
									$result=mysql_query("select pc_username from mlm_login where pc_username='$cBsnsName'");
									$numR   = mysql_num_rows($result);
									if ($numR >0){ 
										$errcount=$errcount+1;
										$errortable[$errcount]="Invalid  Username (Already existing Username )";
										}
    	         				}
    				        }
    	       	 	}
//end of username checking	
//password checking
	if($cPassword==""){
		$errcount=$errcount+1;
		$errortable[$errcount]="password not entered (Empty)";
	}
	else if(strlen($cPassword)<5){
		$errcount=$errcount+1;
		$errortable[$errcount]="Password must have Minimum five characters";
	}
//end of password checking		
//upline  checking
	if($cUpline==""){
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid  Upline Username (Empty)";
	}
	else if(get_id($cUpline)<=-2) {
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid  Upline Username (Not Existing)"; 		
	}
	else
	{
		$nUplineId=get_id($cUpline);
		$_SESSION['nUplineId']=$nUplineId;			

	}
// refferal checking
	if($cRefferal==""){
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid  Refferal Username (Empty)";
	}
	else if(get_id($cRefferal)<=-2) {
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid  Refferal Username (Not Existing)"; 		
	}
	else
	{
		$nRefferalId=get_id($cRefferal);
		$_SESSION['nRefferalId']=$nRefferalId;			

	}
		
				
//SIDE CHECKING
			if($cSideId==""){
				$errcount=$errcount+1;
				$errortable[$errcount]="Invalid Side of Placement(Not Selected)"; 
			}
			else
			{
				if($cSideId=="l")   
	 				$cSide ="Left";
	  			if($cSideId=="r")   
 		  			$cSide="Right";
				if($cSideId=="l" || $cSideId=="r")
				{
					if(get_left_id($nUplineId)!=0)
  						$nRightFlag=1;
	      		if(get_right_id($nUplineId)!=0)
  						$nLeftFlag=1;
				if($nRightFlag==1 && $nLeftFlag==1){
						$errcount=$errcount+1;
						$errortable[$errcount]="Invalid Side of Placement(Left and Right already existing)"; 
				}
				else
				{
					if($nRightFlag==1 && $cSideId=="r")  {
						$errcount=$errcount+1;
						$errortable[$errcount]="Invalid Side of Placement(Right already existing)"; 
					}
					if(nLeftFlag==1 && $cSideId=="l")   {
						$errcount=$errcount+1;
						$errortable[$errcount]="Invalid Side of Placement(Left already existing)" ; 
					}
	    		}
   				}
			}
//SECRET QUESTION AND ANSWER CHECKING
	if($cSecretQuest=="none"){
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid Secret Question(Not Selected)"; 
	}
	if(checkString($cAnsw)) {
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid  Secret Question Answer(Empty)"; 
	}
	else
	{
   		if(strlen($cAnsw)>50) {
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid secret question answer(Maximum fifty characters)";       		
		}
   	}
//ACCOUT PIN VALIDATION
	if($pin1=="none"){
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid  Account pin 1 (empty)";       		
	}
	if($pin2=="none"){
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid  Account pin 2 (empty)";       		
	}
	if($pin3=="none"){
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid  Account pin 3 (empty)";       		
	}
	if($pin4=="none"){
		$errcount=$errcount+1;
		$errortable[$errcount]="Invalid  Account pin 4 (empty)";       		
	}	
//prepaid validation
       if(checkString($ccouponuser))  {
			$errcount=$errcount+1;
			$errortable[$errcount]="Invalid  Prepaid Coupon name in  (Empty)"; 
         }
		else
		{
			$pnumR=0;$presult=="";
			$sqlcoupon="select N_SLNO from mlm_coupon_details where C_COUPON_NAME='$ccouponuser' AND C_COUPON_PASSWORD='$ccouponpassword' AND C_STATUS='N' ";
			$presult=mysql_query($sqlcoupon);
			$pnumR = mysql_num_rows($presult);
			if ($pnumR==0){ 
				$errcount=$errcount+1;
				$errortable[$errcount]="Invalid  Prepaid (Coupon name and password are not matching )";
			}

     	}
//validation completed

//displaing errors
		    if($errcount >0) {
			
			  echo "<br>";
			  echo "<br>";		
              echo "<div align='center'><font size='3' face='Verdana, Arial, Helvetica, sans-serif'><b>Following errors occured</b></font><br><br></div>";
			  echo "<table width='80%' border='0' cellspacing='0' cellpadding='0' align='center'>";
			  for($i=1;$i<=$errcount;$i++) {
                                echo "<tr>"; 
                                echo "<td width='7%'><div align='middle'><font face='Verdana, Arial, Helvetica, sans-serif'><font size='1'><font size='2'><font size='2'><b>".$i."</b></font></font></font></font></div></td>";
                                echo "<td width='93%' align='left' valign='middle'> <font face='Verdana, Arial, Helvetica, sans-serif' size='2'>".$errortable[$i]."</font></td>";
                                echo "</tr>";
		      }
		     echo"<tr>";
		     echo"<td colspan='2' height='20'>"; 
		     echo"<br>";
      	     echo"<div align='center'><b><a href='javascript:history.back();'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>back</font></a></b></div>";
		     echo"<br>";
		     echo"<br>";
		     echo"</tr>";
			 echo"</table>";

		}
		else
		{
			


?>
        <form name="form1" method="post" action="registration_step3.php">
          <input type="hidden" value="<?php echo $randam ?>" name="hidrandam">
          <br>
          <table width="400" border="0" align="center" cellspacing="0">
            <tr>
              <td width="117"><div align="right"></div></td>
              <td width="279"><span class="style7"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">CONFIRMATION FORM</font></span></td>
            </tr>
          </table>
          <br>
          <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
            <tr >
              <td width="773" height="30" align="left" background="images/footer_12.jpg"><span class="style13"> <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">REGISTRATION ADDRESS</font></font></span></td>
            </tr>
            <tr bgcolor="#FFFFFF">
              <td align="center"><table width="100%" border="0" cellspacing="4" cellpadding="4" height="0">
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">Full Name</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td height="0" colspan="4"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $cmbRegStatus ?>,<?php echo $txtFnameReg ?></b></font></td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td height="0"><span class="style8">Sex</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td height="0" colspan="4"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $regtiksex ?></b></font></td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td height="0"><span class="style8">Nationality</span></td>
                    <td><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></b></td>
                    <td height="0" colspan="4"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $regCountry ?></b></font></td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">Address Line1</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td height="0" colspan="4"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $txtAddr1Reg ?></b></font></td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">Address Line2</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td height="0" colspan="4"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $txtAddr2Reg ?></b></font></td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">Address Line3</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td height="0" colspan="4"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $txtAddr3Reg ?></b></font></td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">State</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td width="33%" height="0"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $cmbStateReg ?></b></font></td>
                    <td width="15%" height="0" align="right">&nbsp;</td>
                    <td width="2%" align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td width="24%" height="0">&nbsp;</td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><div align="left"><span class="style8">Pin code</span></div></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td width="33%" height="0"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $txtPinCodeReg ?></b></font></td>
                    <td width="15%" height="0" align="right"><div align="left"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Email ID</b></font></div></td>
                    <td width="2%" align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td width="24%" height="0"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $txtEmailReg ?></b></font></td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">Phone </span></td>
                    <td><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></b></td>
                    <td width="33%" height="0"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $txtPhoneReg ?></b></font></td>
                    <td width="15%" height="0" align="right"><div align="left"><span class="style8">Mobile</span></div></td>
                    <td width="2%" align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td width="24%" height="0"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $txtPhone2Reg ?></b></font></td>
                  </tr>
              </table></td>
            </tr>
            <tr >
              <td height="30" align="left" background="images/footer_12.jpg"><span class="style13"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">CUSTOMER CENTRE DETAILS</font></span></td>
            </tr>
            <tr >
              <td height="30" align="left" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="4" cellpadding="4">
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">SBC Code</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td width="74%" height="0"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><?php echo $cBsnsName ?></font></b> </font></td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">Password</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td height="0"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1" ><?php echo $cPassword ?></font></b> </font></td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">Upline SBC Code</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td height="0"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><?php echo $cUpline ?></font></b>
                          <?php                                
                 /* Name and addr of upline */

				$sql="select c_fname,c_lname,c_addr1 from mlm_address_dtl where  N_ID=$nUplineId and C_TYPE='REGA'";
				$result = mysql_query($sql); 
				$numR   = mysql_num_rows($result);	
				if($numR > 0) {
				
					$numR=$numR-1;
  					$cFnameTemp=mysql_result($result,$numR,"c_fname");
 					$cLnameTemp=mysql_result($result,$numR,"c_lname");
  					$cAddr1Temp=mysql_result($result,$numR,"c_addr1");
				}
				echo "(".$cFnameTemp." ".$cLnameTemp.", ".$cAddr1Temp.")";
?>
                    </font></td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">Side of Placement</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td height="0"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo  $cSide ?></b></font> </td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">Secret Question Selected</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td height="0"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $cSecretQuest ?></b></font></td>
                  </tr>
                  <tr align="left" valign="middle">
                    <td width="24%" height="0"><span class="style8">Answer</span></td>
                    <td width="2%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><b>:</b></font></td>
                    <td height="0"><font size="1" face="Verdana, Arial, Helvetica, sans-serif" ><b><?php echo $cAnsw ?></b></font></td>
                  </tr>
              </table></td>
            </tr>
            <tr bgcolor="#FFFFFF">
              <td height="60" align="center"><div align="center">
                  <input type="submit"  class="BPO_BUTTON" name="Submit" value="Submit" >
              </div></td>
            </tr>
          </table>
          <?php		
			 		

}


?>
          <table width="750" border="0" align="center" cellspacing="0">
            <tr>
              <td></td>
            </tr>
          </table>
      </form></td>
  </tr>
</table></td>
            </tr>
          </table>          
          <p>&nbsp;</p>
</td>
	</tr>
	<tr>
		<td valign="top" background="images/inner_15.jpg"><table width="95%" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><div class="arrowlistmenu">
                <ul>
                  <li><a href="validation_success.php" class="style1 style7">Control Panal  </a></li>
                  <li><a href="registration_step1.php" class="style1">Registration</a></li>
                  <li><a href="geneology.php" class="style1">Geneology </a></li>
                  <li><a href="amount_transfer.php" class="style1">Amount Transfer  </a></li>
                  <li><a href="amount_transfer_details.php" class="style1">Transaction Details  </a></li>
                  <li><a href="pindetails.php" class="style7">Received Coupon Details  </a></li>
				  <li><a href="user_profile.php" class="style7">View Profile   </a></li>
				  <li><a href="change_password.php" class="style7">Password Change </a></li>
				  <li><a href="logout.php" class="style7">Logout  </a></li>
                </ul>
            </div></td>
          </tr>
        </table>	    <p>&nbsp;</p></td>
	</tr>
	<tr>
		<td colspan="10">
			<img src="images/inner_16.jpg" width="1003" height="23" alt=""></td>
	</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>

<?php
		}
    }
	else
	{
		$errormsg="Your session is expeired. Please login again.";
		header("location: index.php?error=$errormsg");
	}
?>	
